package  
{
	import org.flixel.FlxSave;
	/**
	 * ...
	 * @author morgan
	 */
	public class Saving
	{
		
		public static var checkpointPlayerHealth:int = 0;
		public static var restartDishId:int = 0;
		public static var hasGrown:Boolean = false;
		public static var beatenLevelIndex:int = 9;
		public static var showedTut1:Boolean = false;
		public static var showedCandyTut:Boolean = false;
		public static var showedRockTut:Boolean = false;
		public static var showedRainbowTut:Boolean = false;
		public static var kong:*;
		
		public static var save:FlxSave;
		
		public function Saving() 
		{
			
		}
		
		public static function saveData():void
		{
			save.data.beatenLevelIndex = beatenLevelIndex;
			save.data.hasGrown = hasGrown;
			save.data.showedRainbowTut = showedRainbowTut;
			save.data.showedCandyTut = showedCandyTut;
			save.data.showedRockTut = showedRockTut;
		}
		
		public static function loadData():void
		{
			save = new FlxSave();
			save.bind("hungerdog");
			if (save.data.hasGrown != null ) { hasGrown = save.data.hasGrown; }
			if (save.data.beatenLevelIndex != null) { beatenLevelIndex = save.data.beatenLevelIndex; }
			if (save.data.showedRainbowTut != null) { showedRainbowTut = save.data.showedRainbowTut; }
			if (save.data.showedCandyTut != null) { showedCandyTut = save.data.showedCandyTut; }
			if (save.data.showedRockTut != null) { showedRockTut = save.data.showedRockTut; }
		}
		
		public static function clearData():void
		{
			save.erase();
		}
	}

}